package services;

import org.apache.ibatis.session.SqlSession;

import com.aton.db.SessionFactory;

import models.UploadLog;
import models.mappers.UploadLogMapper;
import utils.BizConstants;

public class UploadLogService {
	/**
	 * 保存上传日志
	 *
	 * @Title: saveLog 
	 * @return: void
	 */
	public static void saveLog(UploadLog log){
		SqlSession ss = SessionFactory.getSqlSessionWithoutAutoCommit();
		try{
			UploadLogMapper mapper=ss.getMapper(UploadLogMapper.class);
			mapper.saveLog(log);
			ss.commit();
		}catch(Exception e){
			ss.rollback();
			e.printStackTrace();
		}
		finally{
			ss.close();
		}
	}
}
